<?php

namespace app\api\controller;

use app\api\model\VideoModel;
use think\Controller;

class Video extends Controller {
    function videodetail() {
        $videoid = input('get.videoid');
        $model = new VideoModel();
        $result = $model->videodetail($videoid);
        if ($result) {
            return json($result);
        } else {
            return json(['id' => 0]);
        }

    }

    function videolist() {
        $model = new VideoModel();
        $result = $model->videolist();
        return json($result);
    }
}